#pragma once

#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <string>
#include <vector>
#include "../resource.h"
#include "xml/xmlhelper.h"

typedef WTL::CPoint DUI_Point;
typedef WTL::CSize DUI_Size;
typedef WTL::CRect DUI_Rect;

typedef enum { DUI_BT_NORMAL = 0, DUI_BT_TRANS, DUI_BT_ALPHA } DUI_BITMAP_TYPE;

typedef enum {
  DUI_ALIGNMENT_NONE = 0,
  DUI_ALIGNMENT_LEFT,
  DUI_ALIGNMENT_TOP,
  DUI_ALIGNMENT_RIGHT,
  DUI_ALIGNMENT_BOTTOM,
  DUI_ALIGNMENT_CENTER
} DUI_ALIGNMENT;

typedef enum {
  DUI_STRETCH_NONE = 0,
  DUI_STRETCH_SCALE,
  DUI_STRETCH_FILL,
  DUI_STRETCH_HORIZONTAL,
  DUI_STRETCH_VERTICAL
} DUI_STRETCH;

typedef enum {
  DUI_STATE_NORMAL = 0,
  DUI_STATE_DOWN,
  DUI_STATE_HOVER,
  DUI_STATE_DISABLE,
  DUI_STATE_NORMAL_DISABLE,
  DUI_STATE_DOWN_DISABLE,
  DUI_STATE_HOVER_DISABLE
} DUI_BUTTON_STATE;

void TrackMouseLeave(HWND hWnd);

#define TRANSPARENT_COLOR RGB(255, 0, 255)

#define WM_MSG_TIPS WM_USER + 0x1000
#define WM_MSG_CURSOR WM_USER + 0x1001
#define WM_MSG_ICON_NOTIFY WM_USER + 0x1002
#define WM_MSG_POP_MENU WM_USER + 0x1003
#define WM_MSG_TREE_SCROLLBAR WM_USER + 0x1004
#define WM_MSG_BEGIN_SCROLL WM_USER + 0x1005
#define WM_MSG_ACTIVE WM_USER + 0x1006
#define WM_ASYNC_CALL_LUP WM_USER + 0x1020
#define WM_ASYNC_CALL_RUP WM_USER + 0x1021
#define WM_ASYNC_CALL_DROPUP WM_USER + 0x1022
#define WM_ASYNC_CALL_ENTERKEY WM_USER + 0x1023
#define WM_ASYNC_CALL_TABKEY WM_USER + 0x1024
#define WM_ASYNC_CALL_LDBCLICK WM_USER + 0x1025
#define WM_ASYNC_CALL_LDOWN WM_USER + 0x1026

#define WM_RADIOBUTTON_DOWN WM_USER + 0x2ae0
#define WM_CONTROL_TAB WM_USER + 0x2ae1
#define WM_PATH_ILLCHARACTER WM_USER + 0x2ae2

#define MSG_UPDATE_WINDOW_INVALIDATE (WM_USER + 0x5000)

#define ACTIVE_TIMER 0x200
